from pathlib import Path

from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    # 应用信息
    TITLE: str = "FastAPI Application"
    DESCRIPTION: str = "A FastAPI application with Beanie ODM"
    VERSION: str = "0.1.0"
    API_V1_STR: str = ""
    BASE_URL: str = ""

    # 数据库配置
    MONGO_URI: str = "mongodb://localhost:27017"
    MONGO_DB_NAME: str = "app_db"

    # CORS 设置
    CORS_ORIGINS: str = "*"

    model_config = SettingsConfigDict(env_file=Path.cwd().parent / ".env", extra="allow")


settings = Settings()
